---
title: 'The Blessings of Scarcity: The Cold War Origins of Smaller States Prosperity'
author: "Muhammad Ben Khalid and Steve L. Monroe"
date: 'Code for Analysis in Supplemental Information (SI) (Oct. 2024)'
output: html_document
---


```{r setup, include=FALSE, echo=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

```{r, }
## Table of Contents ########
## 1. Load Packages and Upload Data
## 2. Summary Statistics (SI Table 1)
## 3. H1: Early Independence Size and Post-Cold War Development (SI Figure 1, SI Tables 1 to 15)
## 4. H2: Early Independence Size and Cold War Embedded Liberalism (SI Figures 2 and 3, SI Table 16 to 21)
## 5. Mediation Analysis (SI Table 22)
## 6. Instrumental Variables Analysis (SI Table 23)
## 7. Other (SI Table 24)

# note this analysis was run on R Studio Version:2023.12.1+402  

```



## 1. Load Packages and Upload Data
```{r, include = FALSE, echo=FALSE}


library(stargazer)
library(here)
library(dplyr)
library(foreign)
library(mediation)
library(lmtest)
library(tidyr)
library(ggplot2)
library(broom)
library(cowplot)
library(tidyr)
library(ggrepel)
library(xtable)
library(ivreg)
library(cowplot)
library(dotwhisker)
library(car)

# set working directory
here("")


# upload data
data <- read.csv("data_main.csv")

```


## 2. Summary Statistics (SI Table 1)
```{r tidy=TRUE, tidy.opts=list(width.cutoff=65), echo=FALSE, results='asis'}

## divide avg.pop.1946.75 by millions so it is easier to read

data$avg.pop.1946.75.mil <- data$avg.pop.1946.75 / 1000000

# fix UK variable to include Japan and Austria

data$UK2 <- ifelse(data$uk == "UK", 1, 0)

selected_vars <- c("avg.pop.1946.75.mil", "avg.gdp.1992.20", "avg.rule.1996.19", "fragility_2_mean", "trade.global.1976.91",
                    "publicexp.imf.avg.1976.1995", 
                   "pop.density.1961.75", "rugged", "malpct_aug_avg1965.75", "island", "reliance1", "avg.urbanization.1960.75", "sov.threat2", "demo1946.75", "avg.aid1960.75", "avg_EF.1946.75", "UK2")

var_labels <- c("avg.pop.1946.75.mil" = "Avg. Pop (1946-75, millions)",
                "avg.gdp.1992.20" = "Avg. GDPperCapita PPP (1992-2020)",
                "avg.rule.1996.19" = "Rule of Law (1996-2019)",
                "fragility_2_mean" = "State Instability (1996-2018)",
                  "trade.global.76.91" = "Trade Policy Openness (1976-92)",
                "publicexp.imf.avg.1976.1996" = "Public Sector Exp (Per GDP, 1976-95)",
                 "pop.density.1961.75" = "Pop Density (1946-75)",
                 "rugged" = "Rugged",
                 "malpct_aug_avg1965.75" = "Malaria Rates (1946-75)",
                "island" = "Island",
                "reliance1" = "Reliance on Oil",
                "avg.urbanization.1960.75" = "Urbanization (1946-75)",
                "sov.threat_dummy" = "Threat to Sovereignty",
                "demo1946.75" = "Democracy (1946-75)",
                 "avg.aid1960.75" = "Aid Per Capita (1946-75)",
                  "avg_EF.1946.75" = "Ethnic Fractionalization (1946-75)",
                "UK2" = "UK Colony (1 = Yes)")
                



num_observations <- as.integer(colSums(!is.na(data[selected_vars])))

# Create the summary table with variable names and labels
summary_table <- data.frame(
  Variable = var_labels,
  Obs = num_observations,
  Mean = round(apply(data[selected_vars], 2, mean, na.rm = TRUE), 2),
  SD = round(apply(data[selected_vars], 2, sd, na.rm = TRUE), 2),
  Min = round(apply(data[selected_vars], 2, min, na.rm = TRUE), 2),
  Max = round(apply(data[selected_vars], 2, max, na.rm = TRUE), 2)
)


latex_table <- xtable(summary_table, caption = "Summary Statistics")
si_table1 <- capture.output(print(latex_table, caption.placement = "top", include.rownames = FALSE))


# Hand code to SI

si_table1

```


## 3. Hypothesis 1: Historical Size and Post Cold War Development (SI Figure 1, )


\begin{figure}
  \caption{Scatter Plot of Historical Population Size and GDP per capita} 
  \label{fig:gdp-population}
```{r fig.align='center', warning=FALSE, message=FALSE, echo=FALSE}


plot <- ggplot(data = data, mapping = aes(x = avg.pop.1946.75, y = avg.gdp.1992.20))

si_fig1 = plot + geom_text(mapping = aes(label = Country.Code), size = 3, na.rm = TRUE) +
  scale_x_log10(labels = scales::number) + scale_y_log10(labels = scales::dollar) + geom_smooth(method='lm') +
  labs (x = "Avg Population (1946-75)", y = "Avg. GDP per capita (1992 to 2020)") + 
  theme_bw()

si_fig1
# Export 


```
\end{figure}


```{r}

# H1: SI Diagnostic Tests (SI Table 2)

# Main model (regression 3 from Table 1 in the manuscript)

reg3 <- lm (log.avg.gdp.92.20 ~ log.avg.pop.1946.75 +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 + 
               +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data)


# Re-run analysis exclusding observations with leverage and influence

# Calculate leverage and Cook's distance
leverage <- hatvalues(reg3)
cooks_d <- cooks.distance(reg3)

# Identify high-influential points
n <- nrow(data)
threshold_cooks_d <- 4 / n
high_influential_points <- which(cooks_d > threshold_cooks_d)

# Create a new dataset without high-influential points
data_clean_influential <- data[-high_influential_points, ]

# Rerun the regression model on the cleaned data
reg4 <- lm(log.avg.gdp.92.20 ~ log.avg.pop.1946.75 +
                                log.pop.density.1961.75 + 
                                log.rugged + island +
                                log.reliance1 + log.malpct_aug1965.75 + 
                                log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
                                IndViol2 + uk + log.avg.aid +
                                avg_EF.1946.75 + 
                                region, data = data_clean_influential)


# Calculate studentized residuals
studentized_residuals <- rstudent(reg3)

# Identify outliers
outliers <- which(abs(studentized_residuals) > 2)

# Print outliers
#print(outliers)

# Create a new dataset without outliers
data_clean_outliers <- data[-outliers, ]

# Rerun the regression model on the cleaned data
reg5 <- lm(log.avg.gdp.92.20 ~ log.avg.pop.1946.75 +
                             log.pop.density.1961.75 + 
                             log.rugged + island +
                             log.reliance1 + log.malpct_aug1965.75 + 
                             log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
                             IndViol2 + uk + log.avg.aid +
                             avg_EF.1946.75 + 
                             region, data = data_clean_outliers)

reg3_r <- coeftest(reg3, vcov. = vcovHC(reg3, type = "HC1"))
reg4_r <- coeftest(reg4, vcov. = vcovHC(reg4, type = "HC1"))
reg5_r <- coeftest(reg5, vcov. = vcovHC(reg5, type = "HC1"))


si_table2 <- stargazer(reg3, reg4, reg5,
                        align = TRUE, no.space = TRUE, type = 'text', df = FALSE, digits = 2,
                        font.size = "small", column.sep.width = "0.01pt", float = FALSE, header = FALSE, se = list(reg3_r[,"Std. Error"],  reg4_r[,"Std. Error"], reg5_r[,"Std. Error"]),
                        covariate.labels = c("Avg.Population (1946-75, logged)", "Pop. Density (1946-75, logged)", "Rugged (logged)", "Malaria Risk (1965-75, logged)", "Island", 
                                             "Reliance on Oil (1946-75, logged)", "Urbanization (1946-75, logged)", "Threat to Sovereignty", "Democracy (1946-75)",
                                             "Violence at Independence", "UK Colony", 
                                             "Aid Per Capita (1961-75, logged)", "Historical Ethnic Frac (1946-75)"), 
                        dep.var.labels=c("Log(Avg.GDPpc)"), 
                        omit.stat = c("adj.rsq", "ser"), 
                        omit = c("regionEurope and Central Asia", "regionLatin America and The Caribbean", 
                                 "regionMiddle East and North Africa", "regionSouth Asia", 
                                 "regionSub-Saharan Africa"), 
                        add.lines = list(c("Region Fixed Effects",
                                                "Yes", "Yes", "Yes")),
                        column.labels= c("", "(1992 - 2020)"))
                        
# Export

```

```{r, }

# H1 Diagnostic Test: SI Table 3


# Checking for multicollinearity
vif_values <- vif(reg3)
print(vif_values)


## Re-run analysis without region fixed effects, these have high collinearity.


reg1 <- lm (log.avg.gdp.92.20 ~ log.avg.pop.1946.75, data = data)

# add geographic variables
reg2 <- lm (log.avg.gdp.92.20 ~ log.avg.pop.1946.75 +  log.pop.density.1961.75 + log.rugged + island +  log.reliance1 + log.malpct_aug1965.75, data = data)


reg3 <- lm (log.avg.gdp.92.20 ~ log.avg.pop.1946.75 +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 + 
               +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75, data = data)


reg4 <- lm (hdi2019 ~ log.avg.pop.1946.75 +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 +
               +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75, data = data)


reg5 <- lm (mortality.current ~ log.avg.pop.1946.75 +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 +
              +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75, data = data)


#Calculating heteroscedasticity robust std errors
reg1_r <- coeftest(reg1, vcov. = vcovHC(reg1, type = "HC1"))
reg2_r <- coeftest(reg2, vcov. = vcovHC(reg2, type = "HC1"))
reg3_r <- coeftest(reg3, vcov. = vcovHC(reg3, type = "HC1"))
reg4_r <- coeftest(reg4, vcov. = vcovHC(reg4, type = "HC1"))
reg5_r <- coeftest(reg5, vcov. = vcovHC(reg5, type = "HC1"))



si_table3 <- stargazer(reg1, reg2, reg3, reg4, reg5,
                        align = TRUE, no.space = TRUE, type = 'text', df = FALSE, digits = 2,
                        font.size = "small", column.sep.width = "0.01pt", float = FALSE, header = FALSE, se = list(reg1_r[,"Std. Error"], reg2_r[,"Std. Error"], reg3_r[,"Std. Error"],  reg4_r[,"Std. Error"], reg5_r[,"Std. Error"]),
                        covariate.labels = c("Avg.Population (1946-75, logged)", "Pop. Density (1946-75, logged)", "Rugged (logged)", "Malaria Risk (1965-75, logged)", "Island", 
                                             "Reliance on Oil (1946-75, logged)", "Urbanization (1946-75, logged)", "Threat to Sovereignty", "Democracy (1946-75)",
                                             "Violence at Independence", "UK Colony", 
                                             "Aid Per Capita (1961-75, logged)", "Historical Ethnic Frac (1946-75)"), 
                        dep.var.labels=c("Log(Avg.GDPpc)","HDI", "Infant Mortality"), 
                        omit.stat = c("adj.rsq", "ser"), 
                        add.lines = list(c("Region Fixed Effects",
                                                "No", "No", "No", "No", "No")),
                        column.labels= c("", "(1992 - 2020)", "", "(2019)", "(2019)"))



# Export

```


\begin{table}[ht!] \centering 
  \caption{Robustness Checks: Newly Independent Small States and Post-Cold War Growth in Economic Development} 
  \label{tab:table1} 
  \resizebox{\textwidth}{!}{
```{r tidy=TRUE, tidy.opts=list(width.cutoff=65), warning=FALSE, echo=FALSE, results='asis'}



reg1 <- lm(log(gdp.change1992.18+1)  ~ log.avg.pop.1946.75 + log(gdp1991) + log.pop.density.1961.75 + 
              log.rugged + log.malpct_aug1965.75 + island +
              + log.reliance1 + 
               +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +  IndViol2 + uk + log.avg.aid + avg_EF.1946.75 + 
              region, data = data)
              

data$mortality.change.1992.19 <- (data$mortality.current - data$mortality.current.92) / data$mortality.current.92


reg2 <- lm (mortality.change.1992.19 ~ log.avg.pop.1946.75 + mortality.current.90 + 
              log.pop.density.1961.75 + 
              log.rugged + log.malpct_aug1965.75 + island +
              + log.reliance1 + 
               +log.avg.urbanization.75 + sov.threat2 + demo1946.75 + IndViol2 + uk + log.avg.aid +avg_EF.1946.75 + 
              region, data = data)
              
data$hdi_percent_change_1990_2019 <- data$hdi_change_1990_2019 / data$hdi_1990 
 
reg3 <- lm (hdi_change_1990_2019~ log.avg.pop.1946.75 + hdi_1990 +
              log.pop.density.1961.75 + 
              log.rugged + log.malpct_aug1965.75 + island +
              + log.reliance1 + 
               +log.avg.urbanization.75 + sov.threat2 + demo1946.75 + IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data)
              
 
              
#Calculating heteroscedasticity robust std errors
reg1_r <- coeftest(reg1, vcov. = vcovHC(reg1, type = "HC1"))
reg2_r <- coeftest(reg2, vcov. = vcovHC(reg2, type = "HC1"))
reg3_r <- coeftest(reg3, vcov. = vcovHC(reg3, type = "HC1"))



si_table4 <- stargazer(reg1, reg2, reg3, 
                        align = TRUE, no.space = TRUE, type = 'text', df = FALSE, digits = 2,
                        font.size = "small", column.sep.width = "0.01pt", float = FALSE, header = FALSE,
                        se = list(reg1_r[,"Std. Error"], reg2_r[,"Std. Error"], reg3_r[,"Std. Error"]),
                 covariate.labels = c("Avg.Population (1946-75, logged)", "GDP 1991 (logged)", "Infant Mortality 1990", "HDI 1990", "Pop. Density (1946-75, logged)", "Rugged (logged)", "Malaria Risk (1965-75, logged)", "Island", 
                                             "Reliance on Oil (1946-75, logged)", "Urbanization (1946-75, logged)", "Threat to Sovereignty", "Democracy (1946-75)",
                                             "Violence at Independence", "UK Colony", 
                                             "Aid Per Capita (1961-75, logged)", "Historical Ethnic Frac (1946-75)", "Constant"), 
                        dep.var.labels=c("Change GDPpc (Per)","Change Infant Mort (Per)", "Change HDI"), 
                        omit.stat = c("adj.rsq", "ser"), 
                        omit = c("regionEurope and Central Asia", "regionLatin America and The Caribbean", 
                                 "regionMiddle East and North Africa", "regionSouth Asia", 
                                 "regionSub-Saharan Africa"), 
                        add.lines = list(c("Region Fixed Effects",
                                                "Yes", "Yes", "Yes")),
                        column.labels= c("(1992 - 2018)", "(1992 - 2019)", "(1990 - 2019)"))

```


\begin{table}[ht!] \centering 
  \caption{H1:Newly Independent Small States and Post Cold War Development: No GCC States} 
  \label{tab:h1_rob1} 
  \resizebox{\textwidth}{!}{
```{r tidy=TRUE, tidy.opts=list(width.cutoff=65), warning=FALSE, echo=FALSE, results='asis'}


data$gcc <- ifelse(data$Country.Code == "BHR", 1,
            ifelse(data$Country.Code == "QAT", 1,
            ifelse(data$Country.Code == "OMN", 1,       
            ifelse(data$Country.Code == "KWT", 1,
            ifelse(data$Country.Code == "ARE", 1,
                   0)))))       

data_nogcc <- data[data$gcc == 0, ]



reg1 <- lm (log.avg.gdp.92.20 ~ log.avg.pop.1946.75 + region, data = data_nogcc)

# add geographic variables
reg2 <- lm (log.avg.gdp.92.20 ~ log.avg.pop.1946.75 +  log.pop.density.1961.75 + log.rugged + island +  log.reliance1 + log.malpct_aug1965.75+
              region, data = data_nogcc)


reg3 <- lm (log.avg.gdp.92.20 ~ log.avg.pop.1946.75 +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 + 
               +log.avg.urbanization.75 + sov.threat2 + demo1946.75 + IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data_nogcc)


reg4 <- lm (hdi2019 ~ log.avg.pop.1946.75 +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 +
               +log.avg.urbanization.75 + sov.threat2 + demo1946.75 + IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data_nogcc)


reg5 <- lm (mortality.current ~ log.avg.pop.1946.75 +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 +
              +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data_nogcc)


#Calculating heteroscedasticity robust std errors
reg1_r <- coeftest(reg1, vcov. = vcovHC(reg1, type = "HC1"))
reg2_r <- coeftest(reg2, vcov. = vcovHC(reg2, type = "HC1"))
reg3_r <- coeftest(reg3, vcov. = vcovHC(reg3, type = "HC1"))
reg4_r <- coeftest(reg4, vcov. = vcovHC(reg4, type = "HC1"))
reg5_r <- coeftest(reg5, vcov. = vcovHC(reg5, type = "HC1"))



si_table5 <- stargazer(reg1, reg2, reg3, reg4, reg5,
                        align = TRUE, no.space = TRUE, type = 'text', df = FALSE, digits = 2,
                        font.size = "small", column.sep.width = "0.01pt", float = FALSE, header = FALSE,
                        se = list(reg1_r[,"Std. Error"], reg2_r[,"Std. Error"], reg3_r[,"Std. Error"],  reg4_r[,"Std. Error"], reg5_r[,"Std. Error"]),
                        covariate.labels = c("Avg.Population (1946-75, logged)", "Pop. Density (1946-75, logged)", "Rugged (logged)", "Malaria Risk (1965-75, logged)", "Island", 
                                             "Reliance on Oil (1946-75, logged)", "Urbanization (1946-75, logged)", "Threat to Sovereignty", "Democracy (1946-75)",
                                             "Violence at Independence", "UK Colony", 
                                             "Aid Per Capita (1961-75, logged)", "Historical Ethnic Frac (1946-75)", "Constant"), 
                        dep.var.labels=c("Log(Avg.GDPpc)","HDI", "Infant Mortality"), 
                        omit.stat = c("adj.rsq", "ser"), 
                        omit = c("regionEurope and Central Asia", "regionLatin America and The Caribbean", 
                                 "regionMiddle East and North Africa", "regionSouth Asia", 
                                 "regionSub-Saharan Africa"), 
                        add.lines = list(c("Region Fixed Effects",
                                                "Yes", "Yes", "Yes", "Yes", "Yes")),
                        column.labels= c("", "(1992 - 2020)", "", "(2019)", "(2019)"))



````


\begin{table}[ht!] \centering 
  \caption{H1:Newly Independent Small States and Post Cold War Development: No India} 
  \label{tab:h1_rob2} 
  \resizebox{\textwidth}{!}{
```{r tidy=TRUE, tidy.opts=list(width.cutoff=65), warning=FALSE, echo=FALSE, results='asis'}


data$india <- ifelse(data$Country.Code == "IND", 1, 0)
      

data_noindia <- data[data$india == 0, ]


reg1 <- lm (log.avg.gdp.92.20 ~ log.avg.pop.1946.75 + region, data = data_noindia)

# add geographic variables
reg2 <- lm (log.avg.gdp.92.20 ~ log.avg.pop.1946.75 +  log.pop.density.1961.75 + log.rugged + island +  log.reliance1 + log.malpct_aug1965.75+
              region, data = data_noindia)


reg3 <- lm (log.avg.gdp.92.20 ~ log.avg.pop.1946.75 +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 + 
               +log.avg.urbanization.75 + sov.threat2 + demo1946.75 + IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data_noindia)


reg4 <- lm (hdi2019 ~ log.avg.pop.1946.75 +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 +
               +log.avg.urbanization.75 + sov.threat2 + demo1946.75 + IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data_noindia)


reg5 <- lm (mortality.current ~ log.avg.pop.1946.75 +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 +
              +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data_noindia)


#Calculating heteroscedasticity robust std errors
reg1_r <- coeftest(reg1, vcov. = vcovHC(reg1, type = "HC1"))
reg2_r <- coeftest(reg2, vcov. = vcovHC(reg2, type = "HC1"))
reg3_r <- coeftest(reg3, vcov. = vcovHC(reg3, type = "HC1"))
reg4_r <- coeftest(reg4, vcov. = vcovHC(reg4, type = "HC1"))
reg5_r <- coeftest(reg5, vcov. = vcovHC(reg5, type = "HC1"))



si_table6 <- stargazer(reg1, reg2, reg3, reg4, reg5,
                        align = TRUE, no.space = TRUE, type = 'text', df = FALSE, digits = 2,
                        font.size = "small", column.sep.width = "0.01pt", float = FALSE, header = FALSE,
                        se = list(reg1_r[,"Std. Error"], reg2_r[,"Std. Error"], reg3_r[,"Std. Error"],  reg4_r[,"Std. Error"], reg5_r[,"Std. Error"]),
                        covariate.labels = c("Avg.Population (1946-75, logged)", "Pop. Density (1946-75, logged)", "Rugged (logged)", "Malaria Risk (1965-75, logged)", "Island", 
                                             "Reliance on Oil (1946-75, logged)", "Urbanization (1946-75, logged)", "Threat to Sovereignty", "Democracy (1946-75)",
                                             "Violence at Independence", "UK Colony", 
                                             "Aid Per Capita (1961-75, logged)", "Historical Ethnic Frac (1946-75)", "Constant"), 
                        dep.var.labels=c("Log(Avg.GDPpc)","HDI", "Infant Mortality"), 
                        omit.stat = c("adj.rsq", "ser"), 
                        omit = c("regionEurope and Central Asia", "regionLatin America and The Caribbean", 
                                 "regionMiddle East and North Africa", "regionSouth Asia", 
                                 "regionSub-Saharan Africa"), 
                        add.lines = list(c("Region Fixed Effects",
                                                "Yes", "Yes", "Yes", "Yes", "Yes")),
                        column.labels= c("", "(1992 - 2020)", "", "(2019)", "(2019)"))


```


\begin{table}[ht!] \centering 
  \caption{H1:Newly Independent Small States and Post Cold War Development: No Islands} 
  \label{tab:h1_rob3} 
  \resizebox{\textwidth}{!}{
```{r tidy=TRUE, tidy.opts=list(width.cutoff=65), warning=FALSE, echo=FALSE, results='asis'}


data_noisland <- data[data$island == 0, ]


reg1 <- lm (log.avg.gdp.92.20 ~ log.avg.pop.1946.75 + region, data = data_noisland)

# add geographic variables
reg2 <- lm (log.avg.gdp.92.20 ~ log.avg.pop.1946.75 +  log.pop.density.1961.75 + log.rugged  +  log.reliance1 + log.malpct_aug1965.75+
              region, data = data_noisland)


reg3 <- lm (log.avg.gdp.92.20 ~ log.avg.pop.1946.75 +
              log.pop.density.1961.75 + 
              log.rugged + 
              + log.reliance1 + log.malpct_aug1965.75 + 
               +log.avg.urbanization.75 + sov.threat2 + demo1946.75 + IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data_noisland)


reg4 <- lm (hdi2019 ~ log.avg.pop.1946.75 +
              log.pop.density.1961.75 + 
              log.rugged + 
              + log.reliance1 + log.malpct_aug1965.75 +
               +log.avg.urbanization.75 + sov.threat2 + demo1946.75 + IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data_noisland)


reg5 <- lm (mortality.current ~ log.avg.pop.1946.75 +
              log.pop.density.1961.75 + 
              log.rugged + 
              + log.reliance1 + log.malpct_aug1965.75 +
              +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data_noisland)


#Calculating heteroscedasticity robust std errors
reg1_r <- coeftest(reg1, vcov. = vcovHC(reg1, type = "HC1"))
reg2_r <- coeftest(reg2, vcov. = vcovHC(reg2, type = "HC1"))
reg3_r <- coeftest(reg3, vcov. = vcovHC(reg3, type = "HC1"))
reg4_r <- coeftest(reg4, vcov. = vcovHC(reg4, type = "HC1"))
reg5_r <- coeftest(reg5, vcov. = vcovHC(reg5, type = "HC1"))



si_table7 <- stargazer(reg1, reg2, reg3, reg4, reg5,
                        align = TRUE, no.space = TRUE, type = 'text', df = FALSE, digits = 2,
                        font.size = "small", column.sep.width = "0.01pt", float = FALSE, header = FALSE,
                        se = list(reg1_r[,"Std. Error"], reg2_r[,"Std. Error"], reg3_r[,"Std. Error"],  reg4_r[,"Std. Error"], reg5_r[,"Std. Error"]),
                        covariate.labels = c("Avg.Population (1946-75, logged)", "Pop. Density (1946-75, logged)", "Rugged (logged)", "Malaria Risk (1965-75, logged)",  
                                             "Reliance on Oil (1946-75, logged)", "Urbanization (1946-75, logged)", "Threat to Sovereignty", "Democracy (1946-75)",
                                             "Violence at Independence", "UK Colony", 
                                             "Aid Per Capita (1961-75, logged)", "Historical Ethnic Frac (1946-75)", "Constant"), 
                        dep.var.labels=c("Log(Avg.GDPpc)","HDI", "Infant Mortality"), 
                        omit.stat = c("adj.rsq", "ser"), 
                        omit = c("regionEurope and Central Asia", "regionLatin America and The Caribbean", 
                                 "regionMiddle East and North Africa", "regionSouth Asia", 
                                 "regionSub-Saharan Africa"), 
                        add.lines = list(c("Region Fixed Effects",
                                                "Yes", "Yes", "Yes", "Yes", "Yes")),
                        column.labels= c("", "(1992 - 2020)", "", "(2019)", "(2019)"))


```


\begin{table}[ht!] \centering 
  \caption{H1: Newly Independent Small States and Long Term Economic Development (Post 1975)} 
  \label{tab:h1_rob5_post1975} 
  \resizebox{\textwidth}{!}{
```{r tidy=TRUE, tidy.opts=list(width.cutoff=65), warning=FALSE, echo=FALSE, results='asis'}

data80  <- read.csv("data_1980.csv")

reg1 <- lm (log.avg.gdp.92.20 ~ log.avg.pop.1946.75 + region, data = data80)

# add geographic variables
reg2 <- lm (log.avg.gdp.92.20 ~ log.avg.pop.1946.75 +  log.pop.density.1961.75 + log.rugged + island +  log.reliance1 + log.malpct_aug1965.75+
              region, data = data80)


reg3 <- lm (log.avg.gdp.92.20 ~ log.avg.pop.1946.75 +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 + 
               +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data80)


reg4 <- lm (hdi2019 ~ log.avg.pop.1946.75 +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 +
               +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data80)


reg5 <- lm (mortality.current ~ log.avg.pop.1946.75 +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 +
              +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data80)


#Calculating heteroscedasticity robust std errors
reg1_r <- coeftest(reg1, vcov. = vcovHC(reg1, type = "HC1"))
reg2_r <- coeftest(reg2, vcov. = vcovHC(reg2, type = "HC1"))
reg3_r <- coeftest(reg3, vcov. = vcovHC(reg3, type = "HC1"))
reg4_r <- coeftest(reg4, vcov. = vcovHC(reg4, type = "HC1"))
reg5_r <- coeftest(reg5, vcov. = vcovHC(reg5, type = "HC1"))



si_table8 <- stargazer(reg1, reg2, reg3, reg4, reg5,
                        align = TRUE, no.space = TRUE, type = 'text', df = FALSE, digits = 2,
                        font.size = "small", column.sep.width = "0.01pt", float = FALSE, header = FALSE,
                        se = list(reg1_r[,"Std. Error"], reg2_r[,"Std. Error"], reg3_r[,"Std. Error"],  reg4_r[,"Std. Error"], reg5_r[,"Std. Error"]),
                        covariate.labels = c("Avg.Population (1946-75, logged)", "Pop. Density (1946-75, logged)", "Rugged (logged)", "Malaria Risk (1965-75, logged)", "Island", 
                                             "Reliance on Oil (1946-75, logged)", "Urbanization (1946-75, logged)", "Threat to Sovereignty", "Democracy (1946-75)",
                                             "Violence at Independence", "UK Colony", 
                                             "Aid Per Capita (1961-75, logged)", "Historical Ethnic Frac (1946-75)", "Constant"), 
                        dep.var.labels=c("Log(Avg.GDPpc)","HDI", "Infant Mortality"), 
                        omit.stat = c("adj.rsq", "ser"), 
                        omit = c("regionEurope and Central Asia", "regionLatin America and The Caribbean", 
                                 "regionMiddle East and North Africa", "regionSouth Asia", 
                                 "regionSub-Saharan Africa"), 
                        add.lines = list(c("Region Fixed Effects",
                                                "Yes", "Yes", "Yes", "Yes", "Yes")),
                        column.labels= c("", "(1992 - 2020)", "", "(2019)", "(2019)"))




```


\begin{table}[ht!] \centering 
  \caption{H1: Size at Independence and Post Cold War Economic Development (Different Measures of Cold War Time Period)} 
  \label{tab:table_no} 
  \resizebox{\textwidth}{!}{
```{r tidy=TRUE, tidy.opts=list(width.cutoff=65), warning=FALSE, echo=FALSE, results='asis'}


reg1 <- lm (log.avg.gdp.1995.20 ~ log.avg.pop.1946.75 +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 + 
               +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data)

reg2 <- lm (log.avg.gdp.2000.20 ~ log.avg.pop.1946.75 +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 + 
               +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data)


#Calculating heteroscedasticity robust std errors
reg1_r <- coeftest(reg1, vcov. = vcovHC(reg1, type = "HC1"))
reg2_r <- coeftest(reg2, vcov. = vcovHC(reg2, type = "HC1"))


si_table9 <- stargazer(reg1, reg2, 
                        align = TRUE, no.space = TRUE, type = 'text', df = FALSE, digits = 2,
                        font.size = "small", column.sep.width = "0.01pt", float = FALSE, header = FALSE,
                        se = list(reg1_r[,"Std. Error"], reg2_r[,"Std. Error"]),
                        covariate.labels = c("Avg.Population (1946-75, logged)", "Pop. Density (1946-75, logged)", "Rugged (logged)", "Malaria Risk (1965-75, logged)", "Island", 
                                             "Reliance on Oil (1946-75, logged)", "Urbanization (1946-75, logged)", "Threat to Sovereignty", "Democracy (1946-75)",
                                             "Violence at Independence", "UK Colony", 
                                             "Aid Per Capita (1961-75, logged)", "Historical Ethnic Frac (1946-75)", "Constant"), 
                        dep.var.labels=c("Avg GDPpc (log)","Avg GDPpc (log)"), 
                        omit.stat = c("adj.rsq", "ser"), 
                        omit = c("regionEurope and Central Asia", "regionLatin America and The Caribbean", 
                                 "regionMiddle East and North Africa", "regionSouth Asia", 
                                 "regionSub-Saharan Africa"), 
                        add.lines = list(c("Region Fixed Effects",
                                                "Yes", "Yes", "Yes", "Yes")),
                        column.labels= c("(1995 - 2020)", "(2000 - 2020)"))
                       


````


\begin{table}[ht!] \centering 
  \caption{H1: Size at Independence and Post Cold War Economic Development (Maddison Data)} 
  \label{tab:table_maddison} 
  \resizebox{\textwidth}{!}{
```{r tidy=TRUE, tidy.opts=list(width.cutoff=65), warning=FALSE, echo=FALSE, results='asis'}


reg1 <- lm (log.avg.gdp.92.20 ~ log.avg.pop.1946.75 + log(avg.gdp.ppp.maddison.46.75) +
              region, data = data)

# add geographic variables
reg2 <- lm (log.avg.gdp.92.20 ~ log.avg.pop.1946.75 +
              log(avg.gdp.ppp.maddison.46.75) +
              log.pop.density.1961.75 + log.rugged + island +  log.reliance1 + log.malpct_aug1965.75+
              region, data = data)


reg3 <- lm (log.avg.gdp.92.20 ~ log.avg.pop.1946.75 +
              log(avg.gdp.ppp.maddison.46.75) +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 + 
            + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data)


# Checking for multicollinearity
vif_values <- vif(reg3)
print(vif_values)



reg4 <- lm (hdi2019 ~ log.avg.pop.1946.75 +
              log(avg.gdp.ppp.maddison.46.75) +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 +
            + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data)


reg5 <- lm (mortality.current ~ log.avg.pop.1946.75 +
              log(avg.gdp.ppp.maddison.46.75) +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 +
            + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data)


#Calculating heteroscedasticity robust std errors
reg1_r <- coeftest(reg1, vcov. = vcovHC(reg1, type = "HC1"))
reg2_r <- coeftest(reg2, vcov. = vcovHC(reg2, type = "HC1"))
reg3_r <- coeftest(reg3, vcov. = vcovHC(reg3, type = "HC1"))
reg4_r <- coeftest(reg4, vcov. = vcovHC(reg4, type = "HC1"))
reg5_r <- coeftest(reg5, vcov. = vcovHC(reg5, type = "HC1"))



si_table10 <- stargazer(reg1, reg2, reg3, reg4, reg5,
                        align = TRUE, no.space = TRUE, type = 'text', df = FALSE, digits = 2,
                        font.size = "small", column.sep.width = "0.01pt", float = FALSE, header = FALSE,
                        se = list(reg1_r[,"Std. Error"], reg2_r[,"Std. Error"], reg3_r[,"Std. Error"],  reg4_r[,"Std. Error"], reg5_r[,"Std. Error"]),
                        covariate.labels = c("Avg.Population (1946-75, logged)",
                                             "Avg.GDP.PPP (1946-75, logged)",
                                             "Pop. Density (1946-75, logged)", "Rugged (logged)", "Malaria Risk (1965-75, logged)",
                                             "Island", 
                                             "Reliance on Oil (1946-75, logged)",  "Threat to Sovereignty", "Democracy (1946-75)",
                                             "Violence at Independence", "UK Colony", 
                                             "Aid Per Capita (1961-75, logged)", "Historical Ethnic Frac (1946-75)"), 
                        dep.var.labels=c("Log(Avg.GDPpc)","HDI", "Infant Mortality"), 
                        omit.stat = c("adj.rsq", "ser"), 
                        omit = c("regionEurope and Central Asia", "regionLatin America and The Caribbean", 
                                 "regionMiddle East and North Africa", "regionSouth Asia", 
                                 "regionSub-Saharan Africa"), 
                        add.lines = list(c("Region Fixed Effects",
                                                "Yes", "Yes", "Yes", "Yes", "Yes")),
                        column.labels= c("", "(1992 - 2020)", "", "(2019)", "(2019)"))


````


\begin{table}[ht!] \centering 
  \caption{H1: Size at Independence and Post Cold War Economic Development (Controling for Year of Independence)} 
  \label{tab:table1} 
  \resizebox{\textwidth}{!}{
```{r tidy=TRUE, tidy.opts=list(width.cutoff=65), warning=FALSE, echo=FALSE, results='asis'}

# yoi1945: years independent since 1945

data$yoi1945 <- data$cow.entry - 1945

reg1 <- lm (log.avg.gdp.92.20 ~ log.avg.pop.1946.75 + yoi1945 + region, data = data)

# add geographic variables
reg2 <- lm (log.avg.gdp.92.20 ~ log.avg.pop.1946.75 + yoi1945 + log.pop.density.1961.75 + log.rugged + island +  log.reliance1 + log.malpct_aug1965.75+
              region, data = data)


reg3 <- lm (log.avg.gdp.92.20 ~ log.avg.pop.1946.75 +
              yoi1945 +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 + 
               +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + region, data = data)


# Checking for multicollinearity
vif_values <- vif(reg3)
print(vif_values)




reg4 <- lm (hdi2019 ~ log.avg.pop.1946.75 +
              yoi1945 +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 +
               +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data)


reg5 <- lm (mortality.current ~ log.avg.pop.1946.75 +
              yoi1945 +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 +
              +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data)


#Calculating heteroscedasticity robust std errors
reg1_r <- coeftest(reg1, vcov. = vcovHC(reg1, type = "HC1"))
reg2_r <- coeftest(reg2, vcov. = vcovHC(reg2, type = "HC1"))
reg3_r <- coeftest(reg3, vcov. = vcovHC(reg3, type = "HC1"))
reg4_r <- coeftest(reg4, vcov. = vcovHC(reg4, type = "HC1"))
reg5_r <- coeftest(reg5, vcov. = vcovHC(reg5, type = "HC1"))



si_table11 <- stargazer(reg1, reg2, reg3, reg4, reg5,
                        align = TRUE, no.space = TRUE, type = 'text', df = FALSE, digits = 2,
                        font.size = "small", column.sep.width = "0.01pt", float = FALSE, header = FALSE, se = list(reg1_r[,"Std. Error"], reg2_r[,"Std. Error"], reg3_r[,"Std. Error"],  reg4_r[,"Std. Error"], reg5_r[,"Std. Error"]),
                        covariate.labels = c("Avg.Population (1946-75, logged)",
                                             "Years Independent (since 1945)",
                                             
                                             "Pop. Density (1946-75, logged)", "Rugged (logged)", "Malaria Risk (1965-75, logged)", "Island", 
                                             "Reliance on Oil (1946-75, logged)", "Urbanization (1946-75, logged)", "Threat to Sovereignty", "Democracy (1946-75)",
                                             "Violence at Independence", "UK Colony", 
                                             "Aid Per Capita (1961-75, logged)", "Historical Ethnic Frac (1946-75)"), 
                        dep.var.labels=c("Log(Avg.GDPpc)","HDI", "Infant Mortality"), 
                        omit.stat = c("adj.rsq", "ser"), 
                        omit = c("regionEurope and Central Asia", "regionLatin America and The Caribbean", 
                                 "regionMiddle East and North Africa", "regionSouth Asia", 
                                 "regionSub-Saharan Africa"), 
                        add.lines = list(c("Region Fixed Effects",
                                                "Yes", "Yes", "Yes", "Yes", "Yes")),
                        column.labels= c("", "(1992 - 2020)", "", "(2019)", "(2019)"))
                        


````


```{r, }
# Upload long data for REWB analysis

data_long2 <- read.csv("data_main_long.csv")

# download panel package plm

library("plm")

pdata <- pdata.frame(data_long2, index = c("Country.Code", "Early_Year"))

# Clean variables and make them appropriate for REWB analysis

# log independent variable

pdata$log_early_independence_size <- log(pdata$early_independence_size)


## Within and Between for variables that change with time

# Independent Variable: Early Independence Size

pdata$within_early_size_log <- pdata$log_early_independence_size - ave(pdata$log_early_independence_size, pdata$Country.Code, FUN = mean)


reg1 <- plm(log.gdp ~ within_early_size_log + log.avg.pop.1946.75 +
           + region,  data = pdata, model = "random")
                
## add geographic controls


reg2 <- plm(log.gdp ~ within_early_size_log +
              log.avg.pop.1946.75 +
              log.pop.density.1961.75 +
              log.rugged + island + log.reliance1 + log.malpct_aug1965.75+
           + region,  data = pdata, model = "random")    

## add socio-economic controls


reg3 <- plm(log.gdp ~ within_early_size_log +
              log.avg.pop.1946.75  +
              log.pop.density.1961.75 +
              log.rugged + island + log.reliance1 + log.malpct_aug1965.75+
              log.avg.urbanization.75  + 
              sov.threat2 + 
             demo1946.75 +
              IndViol2 +
              uk + 
              log.avg.aid +
               avg_EF.1946.75  +
              region,  data = pdata, model = "random")   

reg4 <- plm(hdi ~  within_early_size_log +
              log.avg.pop.1946.75  +
              log.pop.density.1961.75 +
              log.rugged + island + log.reliance1 + log.malpct_aug1965.75+
              log.avg.urbanization.75  + 
              sov.threat2 + 
             demo1946.75 +
              IndViol2 +
              uk + 
              log.avg.aid +
               avg_EF.1946.75  +
              region,  data = pdata, model = "random")  

reg5 <- plm(mortality ~  
              within_early_size_log +
              log.avg.pop.1946.75  +
              log.pop.density.1961.75 +
              log.rugged + island + log.reliance1 + log.malpct_aug1965.75+
              log.avg.urbanization.75  + 
              sov.threat2 + 
             demo1946.75 +
              IndViol2 +
              uk + 
              log.avg.aid +
               avg_EF.1946.75  +
              region, data = pdata, model = "random")  


## Cluster Standard Errors at the Country Level


clustered_se <- vcovHC(reg1, type = "HC1", cluster = "group")

reg1_r <- sqrt(diag(clustered_se))

clustered_se <- vcovHC(reg2, type = "HC1", cluster = "group")

reg2_r <- sqrt(diag(clustered_se))


clustered_se <- vcovHC(reg3, type = "HC1", cluster = "group")

reg3_r <- sqrt(diag(clustered_se))


clustered_se <- vcovHC(reg4, type = "HC1", cluster = "group")

reg4_r <- sqrt(diag(clustered_se))


clustered_se <- vcovHC(reg5, type = "HC1", cluster = "group")

reg5_r <- sqrt(diag(clustered_se))



si_table12 <- stargazer(reg1, reg2, reg3, reg4, reg5,
                        align = TRUE, no.space = TRUE, type = 'text', df = FALSE, digits = 2,
                        font.size = "small", column.sep.width = "0.01pt", float = FALSE, header = FALSE,   se = list(reg1_r, reg2_r, reg3_r, reg4_r, reg5_r),
                        covariate.labels = c("Population (logged, Within)",
                          "Avg.Population (1946-75, logged, Between)", "Pop. Density (1946-75, logged)", "Rugged (logged)", "Malaria Risk (1965-75, logged)", "Island", 
                                             "Reliance on Oil (1946-75, logged)", "Urbanization (1946-75, logged)", "Threat to Sovereignty", "Democracy (1946-75)",
                                             "Violence at Independence", "UK Colony", 
                                             "Aid Per Capita (1961-75, logged)", "Historical Ethnic Frac (1946-75)" ), 
                        dep.var.labels=c("Log(Avg.GDPpc)","HDI", "Infant Mortality"), 
                        omit.stat = c("adj.rsq", "ser"), 
                        omit = c("regionEurope and Central Asia", "regionLatin America and The Caribbean", 
                                 "regionMiddle East and North Africa", "regionSouth Asia", 
                                 "regionSub-Saharan Africa"), 
                        add.lines = list(c("Region Fixed Effects",
                                                "Yes", "Yes", "Yes", "Yes", "Yes"),
                                     c("Countries",
                                             "80", "73", "61", "62", "63")))
                     


```



\begin{table}[ht!] \centering 
  \caption{H1: Size at Independence and Post Cold War Economic Development (Inclusive Institutions)} 
  \label{tab:table1} 
  \resizebox{\textwidth}{!}{
```{r tidy=TRUE, tidy.opts=list(width.cutoff=65), warning=FALSE, echo=FALSE, results='asis'}


reg1 <- lm (avg.rule.1996.19 ~ log.avg.pop.1946.75 + region, data = data)

# add geographic variables
reg2 <- lm (avg.rule.1996.19  ~ log.avg.pop.1946.75 +  log.pop.density.1961.75 + log.rugged + island +  log.reliance1 + log.malpct_aug1965.75+
              region, data = data)


reg3 <- lm (avg.rule.1996.19  ~ log.avg.pop.1946.75 +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 + 
               +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data)


reg4 <- lm (cpi~ log.avg.pop.1946.75 +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 +
               +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data)


reg5 <- lm (expropriation ~ log.avg.pop.1946.75 +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 +
              +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data)


#Calculating heteroscedasticity robust std errors
reg1_r <- coeftest(reg1, vcov. = vcovHC(reg1, type = "HC1"))
reg2_r <- coeftest(reg2, vcov. = vcovHC(reg2, type = "HC1"))
reg3_r <- coeftest(reg3, vcov. = vcovHC(reg3, type = "HC1"))
reg4_r <- coeftest(reg4, vcov. = vcovHC(reg4, type = "HC1"))
reg5_r <- coeftest(reg5, vcov. = vcovHC(reg5, type = "HC1"))



si_table13 <- stargazer(reg1, reg2, reg3, reg4, reg5,
                        align = TRUE, no.space = TRUE, type = 'text', df = FALSE, digits = 2,
                        font.size = "small", column.sep.width = "0.01pt", float = FALSE, header = FALSE,
                        se = list(reg1_r[,"Std. Error"], reg2_r[,"Std. Error"], reg3_r[,"Std. Error"],  reg4_r[,"Std. Error"], reg5_r[,"Std. Error"]),
                        covariate.labels = c("Avg.Population (1946-75, logged)", "Pop. Density (1946-75, logged)", "Rugged (logged)", "Malaria Risk (1965-75, logged)", "Island", 
                                             "Reliance on Oil (1946-75, logged)", "Urbanization (1946-75, logged)", "Threat to Sovereignty", "Democracy (1946-75)",
                                             "Violence at Independence", "UK Colony", 
                                             "Aid Per Capita (1961-75, logged)", "Historical Ethnic Frac (1946-75)", "Constant"), 
                        dep.var.labels=c("Rule of Law","CPI", "Exprop"), 
                        omit.stat = c("adj.rsq", "ser"), 
                        omit = c("regionEurope and Central Asia", "regionLatin America and The Caribbean", 
                                 "regionMiddle East and North Africa", "regionSouth Asia", 
                                 "regionSub-Saharan Africa"), 
                        add.lines = list(c("Region Fixed Effects",
                                                "Yes", "Yes", "Yes", "Yes", "Yes")),
                        column.labels= c("", "(1996 - 2019)", "", "(2012 - 2020)", "(2019)"))


````


\begin{table}[ht!] \centering 
  \caption{H1: Size at Independence and Post Cold War Economic Development (Political Stability)} 
  \label{tab:table1} 
  \resizebox{\textwidth}{!}{
```{r tidy=TRUE, tidy.opts=list(width.cutoff=65), warning=FALSE, echo=FALSE, results='asis'}


reg1 <- lm (fragility_2_mean ~ log.avg.pop.1946.75 + region, data = data)

# add geographic variables
reg2 <- lm (fragility_2_mean  ~ log.avg.pop.1946.75 +  log.pop.density.1961.75 + log.rugged + island +  log.reliance1 + log.malpct_aug1965.75+
              region, data = data)


reg3 <- lm (fragility_2_mean  ~ log.avg.pop.1946.75 +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 + 
               +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data)


reg4 <- lm (log_instability_index1992.20~ log.avg.pop.1946.75 +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 +
               +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data)


reg5 <- lm (poltical_risk_icrg.1992.22~ log.avg.pop.1946.75 +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 +
              +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data)


#Calculating heteroscedasticity robust std errors
reg1_r <- coeftest(reg1, vcov. = vcovHC(reg1, type = "HC1"))
reg2_r <- coeftest(reg2, vcov. = vcovHC(reg2, type = "HC1"))
reg3_r <- coeftest(reg3, vcov. = vcovHC(reg3, type = "HC1"))
reg4_r <- coeftest(reg4, vcov. = vcovHC(reg4, type = "HC1"))
reg5_r <- coeftest(reg5, vcov. = vcovHC(reg5, type = "HC1"))



si_table14 <- stargazer(reg1, reg2, reg3, reg4, reg5,
                        align = TRUE, no.space = TRUE, type = 'text', df = FALSE, digits = 2,
                        font.size = "small", column.sep.width = "0.01pt", float = FALSE, header = FALSE,
                        se = list(reg1_r[,"Std. Error"], reg2_r[,"Std. Error"], reg3_r[,"Std. Error"],  reg4_r[,"Std. Error"], reg5_r[,"Std. Error"]),
                        covariate.labels = c("Avg.Population (1946-75, logged)", "Pop. Density (1946-75, logged)", "Rugged (logged)", "Malaria Risk (1965-75, logged)", "Island", 
                                             "Reliance on Oil (1946-75, logged)", "Urbanization (1946-75, logged)", "Threat to Sovereignty", "Democracy (1946-75)",
                                             "Violence at Independence", "UK Colony", 
                                             "Aid Per Capita (1961-75, logged)", "Historical Ethnic Frac (1946-75)", "Constant"), 
                        dep.var.labels=c("State Instability","Instability Index", "Political Risk"), 
                        omit.stat = c("adj.rsq", "ser"), 
                        omit = c("regionEurope and Central Asia", "regionLatin America and The Caribbean", 
                                 "regionMiddle East and North Africa", "regionSouth Asia", 
                                 "regionSub-Saharan Africa"), 
                        add.lines = list(c("Region Fixed Effects",
                                                "Yes", "Yes", "Yes", "Yes", "Yes")),
                        column.labels= c("", "(1996 - 2018)", "", "(1992 - 2020)", "(1992 - 2022)"))
                   


````


\begin{table}[ht!] \centering 
  \caption{H1: Size at Independence and Post Cold War Population Growth} 
  \label{tab:table1} 
  \resizebox{\textwidth}{!}{
```{r tidy=TRUE, tidy.opts=list(width.cutoff=65), warning=FALSE, echo=FALSE, results='asis'}


reg1 <- lm (log(int.migrant + 1) ~ log.avg.pop.1946.75 + region, data = data)

# add geographic variables
reg2 <- lm (log(int.migrant + 1)  ~ log.avg.pop.1946.75 +  log.pop.density.1961.75 + log.rugged + island +  log.reliance1 + log.malpct_aug1965.75+
              region, data = data)


reg3 <- lm (log(int.migrant + 1)  ~ log.avg.pop.1946.75 +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 + 
               +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data)


data$cw_pop_growth <- (data$X2020 - data$X1992) / data$X1992



reg4 <- lm (log(cw_pop_growth + 1) ~ log.avg.pop.1946.75 + region, data = data)

# add geographic variables
reg5 <- lm (log(cw_pop_growth + 1)  ~ log.avg.pop.1946.75 +  log.pop.density.1961.75 + log.rugged + island +  log.reliance1 + log.malpct_aug1965.75+
              region, data = data)

reg6 <- lm (log(cw_pop_growth + 1)~ log.avg.pop.1946.75 +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 +
               +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data)


#Calculating heteroscedasticity robust std errors
reg1_r <- coeftest(reg1, vcov. = vcovHC(reg1, type = "HC1"))
reg2_r <- coeftest(reg2, vcov. = vcovHC(reg2, type = "HC1"))
reg3_r <- coeftest(reg3, vcov. = vcovHC(reg3, type = "HC1"))
reg4_r <- coeftest(reg4, vcov. = vcovHC(reg4, type = "HC1"))
reg5_r <- coeftest(reg5, vcov. = vcovHC(reg5, type = "HC1"))
reg6_r <- coeftest(reg6, vcov. = vcovHC(reg6, type = "HC1"))


si_table15 <- stargazer(reg1, reg2, reg3, reg4, reg5, reg6,
                        align = TRUE, no.space = TRUE, type = 'text', df = FALSE, digits = 2,
                        font.size = "small", column.sep.width = "0.01pt", float = FALSE, header = FALSE,
                        se = list(reg1_r[,"Std. Error"], reg2_r[,"Std. Error"], reg3_r[,"Std. Error"],  reg4_r[,"Std. Error"], reg5_r[,"Std. Error"], reg6_r[,"Std. Error"]),
                        covariate.labels = c("Avg.Population (1946-75, logged)", "Pop. Density (1946-75, logged)", "Rugged (logged)", "Malaria Risk (1965-75, logged)", "Island", 
                                             "Reliance on Oil (1946-75, logged)", "Urbanization (1946-75, logged)", "Threat to Sovereignty", "Democracy (1946-75)",
                                             "Violence at Independence", "UK Colony", 
                                             "Aid Per Capita (1961-75, logged)", "Historical Ethnic Frac (1946-75)", "Constant"), 
                        dep.var.labels=c("Migrant Share (Log)", "Pop Growth (Per, Log)"), 
                        omit.stat = c("adj.rsq", "ser"), 
                        omit = c("regionEurope and Central Asia", "regionLatin America and The Caribbean", 
                                 "regionMiddle East and North Africa", "regionSouth Asia", 
                                 "regionSub-Saharan Africa"), 
                        add.lines = list(c("Region Fixed Effects",
                                                "Yes", "Yes", "Yes", "Yes", "Yes", "Yes")),
                        column.labels= c("", "(2019)", "", "", "(1992 - 2020)", ""))


````


## 4. Hypothesis 2: Early Independence Size and Cold War Embedded Liberalism

\begin{table}[ht!] \centering 
  \caption{Early State Size and Cold War Embeddedness} 
  \label{tab:table4public} 
  \resizebox{\textwidth}{!}{
```{r tidy=TRUE, tidy.opts=list(width.cutoff=65), warning=FALSE, echo=FALSE, results='asis'}


reg1 <- lm (trade.global.1976.91 ~ log.avg.pop.1946.75 + region, data = data)

## Add political controls

reg2 <- lm (trade.global.1976.91 ~ 
              log.avg.pop.1946.75 +
               log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 +
                 +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data)


reg3 <- lm (publicexp.imf.avg.1976.1995 ~ log.avg.pop.1946.75 + region, data = data)


reg4 <- lm (publicexp.imf.avg.1976.1995 ~ 
              log.avg.pop.1946.75 +
               log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 +
                 +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data)


reg5 <- lm (cw_embed ~ log.avg.pop.1946.75 + region, data = data)


reg6 <- lm (cw_embed ~ 
              log.avg.pop.1946.75 +
               log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 +
                 +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data)

            
stargazer(reg1, reg2, reg3, reg4, reg5, reg6)

#Calculating heteroscedasticity robust std errors
reg1_r <- coeftest(reg1, vcov. = vcovHC(reg1, type = "HC1"))
reg2_r <- coeftest(reg2, vcov. = vcovHC(reg2, type = "HC1"))
reg3_r <- coeftest(reg3, vcov. = vcovHC(reg3, type = "HC1"))
reg4_r <- coeftest(reg4, vcov. = vcovHC(reg4, type = "HC1"))
reg5_r <- coeftest(reg5, vcov. = vcovHC(reg5, type = "HC1"))
reg6_r <- coeftest(reg6, vcov. = vcovHC(reg6, type = "HC1"))

              
si_table16 <- stargazer(reg1, reg2, reg3, reg4, reg5, reg6, 
                        align = TRUE, no.space = TRUE, type = 'text', df = FALSE, digits = 2, font.size = "small",
                        column.sep.width = "0.01pt", float = FALSE,header = FALSE,
                        se = list(reg1_r[,"Std. Error"],  reg2_r[,"Std. Error"], reg3_r[,"Std. Error"], reg4_r[, "Std. Error"], reg5_r[, "Std. Error"], reg6_r[, "Std. Error"]),
                        covariate.labels = c("Avg.Population (1946-75, log)", "Pop. Density (1946-75, log)", "Rugged (log)", "Island",
                         "Reliance on Oil (1946-75, log)", "Malaria Risk (1965-75, log)", "Urbanization (1946-75, log)", "Threat to Sovereignty",
                                               "Democracy (1946-75)", "Violence at Independence", "UK Colony", 
                                               "Aid Per Capita (1960-75, log)", "Historical Ethnic Frac (1946-75)", "Constant",
                                               "Europe and Central Asia",
                                               "Latin America and The Caribbean", 
                                               "Middle East and North Africa", "South Asia", "Sub-Saharan Africa"),
                        omit.stat = c("adj.rsq", "ser"), 
                        omit = c("regionEurope and Central Asia", "regionLatin America and The Caribbean", 
                                 "regionMiddle East and North Africa", "regionSouth Asia", 
                                 "regionSub-Saharan Africa"), 
                        dep.var.labels=c("Trade Policy Open", "Public Sector Size", "Cold War EL"), 
                         column.labels= c("(1976-1991)", "(1976-1991)", "(1976 -1995)", "(1976-1995)", "(1976-1995)", "(1976-1995)"),
                        
                        
                        add.lines = list(c("Region Fixed Effects",
                                                "Yes", "Yes", "Yes", "Yes", "Yes", "Yes")))
                        
# Export to Overleaf

     
```

}
\end{table}
\newpage



\begin{table}[ht!] \centering 
  \caption{H2: Cold War EL and Post Cold War Economic Development} 
  \label{tab:table1} 
  \resizebox{\textwidth}{!}{
```{r tidy=TRUE, tidy.opts=list(width.cutoff=65), warning=FALSE, echo=FALSE, results='asis'}


reg1 <- lm (log.avg.gdp.92.20 ~ cw_embed  + region, data = data)

# add geographic variables
reg2 <- lm (log.avg.gdp.92.20 ~ cw_embed  +  log.pop.density.1961.75 + log.rugged + island +  log.reliance1 + log.malpct_aug1965.75+
              region, data = data)


reg3 <- lm (log.avg.gdp.92.20 ~ cw_embed  +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 + 
               +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data)


reg4 <- lm (hdi2019 ~ cw_embed  +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 +
               +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data)


reg5 <- lm (mortality.current ~ cw_embed  +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 +
              +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data)


#Calculating heteroscedasticity robust std errors
reg1_r <- coeftest(reg1, vcov. = vcovHC(reg1, type = "HC1"))
reg2_r <- coeftest(reg2, vcov. = vcovHC(reg2, type = "HC1"))
reg3_r <- coeftest(reg3, vcov. = vcovHC(reg3, type = "HC1"))
reg4_r <- coeftest(reg4, vcov. = vcovHC(reg4, type = "HC1"))
reg5_r <- coeftest(reg5, vcov. = vcovHC(reg5, type = "HC1"))



si_table17 <- stargazer(reg1, reg2, reg3, reg4, reg5,
                        align = TRUE, no.space = TRUE, type = 'text', df = FALSE, digits = 2,
                        font.size = "small", column.sep.width = "0.01pt", float = FALSE, header = FALSE,
                        se = list(reg1_r[,"Std. Error"], reg2_r[,"Std. Error"], reg3_r[,"Std. Error"],  reg4_r[,"Std. Error"], reg5_r[,"Std. Error"]),
                        covariate.labels = c("Cold War EL", "Pop. Density (1946-75, logged)", "Rugged (logged)", "Malaria Risk (1965-75, logged)", "Island", 
                                             "Reliance on Oil (1946-75, logged)", "Urbanization (1946-75, logged)", "Threat to Sovereignty", "Democracy (1946-75)",
                                             "Violence at Independence", "UK Colony", 
                                             "Aid Per Capita (1961-75, logged)", "Historical Ethnic Frac (1946-75)", "Constant"), 
                        dep.var.labels=c("Log(Avg.GDPpc)","HDI", "Infant Mortality"), 
                        omit.stat = c("adj.rsq", "ser"), 
                        omit = c("regionEurope and Central Asia", "regionLatin America and The Caribbean", 
                                 "regionMiddle East and North Africa", "regionSouth Asia", 
                                 "regionSub-Saharan Africa"), 
                        add.lines = list(c("Region Fixed Effects",
                                                "Yes", "Yes", "Yes", "Yes", "Yes")),
                        column.labels= c("", "(1992 - 2020)", "", "(2019)", "(2019)"))



````


%% SI Figures 2 and 3

\begin{figure}
  \caption{Scatter Plot of Historical Population Size and GDP per capita} 
  \label{fig:gdp-population}
```{r fig.align='center', warning=FALSE, message=FALSE, echo=FALSE}


# Avg GDP (1992 - 2020)

plot <- ggplot(data = data, mapping = aes(x = cw_embed, y = avg.gdp.1992.20))


si_figure2 = plot + geom_text(mapping = aes(label = Country.Code), size = 3, na.rm = TRUE, poisition = position_jitter(width = 2.5, height = 2.5)) +
 # scale_x_log10(labels = scales::number)
scale_y_log10(labels = scales::dollar) + geom_smooth(method='lm') +
  labs (x = "Cold War EL (1976 - 1995)", y = "Avg GDP per capita (1992 - 2020)") + theme_bw()


# Export 


# HDI 2019

plot <- ggplot(data = data, mapping = aes(x = cw_embed, y = hdi2019))


si_figure3 = plot + geom_text(mapping = aes(label = Country.Code), size = 3, na.rm = TRUE, poisition = position_jitter(width = 2.5, height = 2.5)) +
 geom_smooth(method='lm') +
  labs (x = "Cold War EL (1976 - 1995)", y = "HDI 2019") + 
  theme_bw()

si_figure3
# Export



```
\end{figure}



\begin{table}[ht!] \centering 
  \caption{H2: Cold War Openness and Post Cold War Economic Development (Inclusive Institutions)} 
  \label{tab:table1} 
  \resizebox{\textwidth}{!}{
```{r tidy=TRUE, tidy.opts=list(width.cutoff=65), warning=FALSE, echo=FALSE, results='asis'}


reg1 <- lm (avg.rule.1996.19 ~ trade.global.1976.91 + region, data = data)

# add geographic variables
reg2 <- lm (avg.rule.1996.19  ~ trade.global.1976.91 +  log.pop.density.1961.75 + log.rugged + island +  log.reliance1 + log.malpct_aug1965.75+
              region, data = data)


reg3 <- lm (avg.rule.1996.19  ~ trade.global.1976.91 +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 + 
               +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data)


reg4 <- lm (cpi~ trade.global.1976.91 +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 +
               +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data)


reg5 <- lm (expropriation ~ trade.global.1976.91 +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 +
              +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data)


#Calculating heteroscedasticity robust std errors
reg1_r <- coeftest(reg1, vcov. = vcovHC(reg1, type = "HC1"))
reg2_r <- coeftest(reg2, vcov. = vcovHC(reg2, type = "HC1"))
reg3_r <- coeftest(reg3, vcov. = vcovHC(reg3, type = "HC1"))
reg4_r <- coeftest(reg4, vcov. = vcovHC(reg4, type = "HC1"))
reg5_r <- coeftest(reg5, vcov. = vcovHC(reg5, type = "HC1"))



si_table18 <- stargazer(reg1, reg2, reg3, reg4, reg5,
                        align = TRUE, no.space = TRUE, type = 'text', df = FALSE, digits = 2,
                        font.size = "small", column.sep.width = "0.01pt", float = FALSE, header = FALSE,
                        se = list(reg1_r[,"Std. Error"], reg2_r[,"Std. Error"], reg3_r[,"Std. Error"],  reg4_r[,"Std. Error"], reg5_r[,"Std. Error"]),
                        covariate.labels = c("Trade Policy Openness (1976-91)", "Pop. Density (1946-75, logged)", "Rugged (logged)", "Malaria Risk (1965-75, logged)", "Island", 
                                             "Reliance on Oil (1946-75, logged)", "Urbanization (1946-75, logged)", "Threat to Sovereignty", "Democracy (1946-75)",
                                             "Violence at Independence", "UK Colony", 
                                             "Aid Per Capita (1961-75, logged)", "Historical Ethnic Frac (1946-75)", "Constant"), 
                        dep.var.labels=c("Rule of Law","CPI", "Exprop"), 
                        omit.stat = c("adj.rsq", "ser"), 
                        omit = c("regionEurope and Central Asia", "regionLatin America and The Caribbean", 
                                 "regionMiddle East and North Africa", "regionSouth Asia", 
                                 "regionSub-Saharan Africa"), 
                        add.lines = list(c("Region Fixed Effects",
                                                "Yes", "Yes", "Yes", "Yes", "Yes")),
                        column.labels= c("", "(1996 - 2019)", "", "(2012 - 2020)", "(2019)"))



````



\begin{table}[ht!] \centering 
  \caption{H2: Cold War Public Sector Expenditures and Post-Cold War Stability} 
  \label{tab:table1} 
  \resizebox{\textwidth}{!}{
```{r tidy=TRUE, tidy.opts=list(width.cutoff=65), warning=FALSE, echo=FALSE, results='asis'}


reg1 <- lm (fragility_2_mean ~ publicexp.imf.avg.1976.1995 + region, data = data)

# add geographic variables
reg2 <- lm (fragility_2_mean  ~ publicexp.imf.avg.1976.1995 +  log.pop.density.1961.75 + log.rugged + island +  log.reliance1 + log.malpct_aug1965.75+
              region, data = data)


reg3 <- lm (fragility_2_mean  ~ publicexp.imf.avg.1976.1995 +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 + 
               +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data)


reg4 <- lm (log_instability_index1992.20~ publicexp.imf.avg.1976.1995 +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 +
               +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data)


reg5 <- lm (poltical_risk_icrg.1992.22~ publicexp.imf.avg.1976.1995 +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 +
              +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data)


#Calculating heteroscedasticity robust std errors
reg1_r <- coeftest(reg1, vcov. = vcovHC(reg1, type = "HC1"))
reg2_r <- coeftest(reg2, vcov. = vcovHC(reg2, type = "HC1"))
reg3_r <- coeftest(reg3, vcov. = vcovHC(reg3, type = "HC1"))
reg4_r <- coeftest(reg4, vcov. = vcovHC(reg4, type = "HC1"))
reg5_r <- coeftest(reg5, vcov. = vcovHC(reg5, type = "HC1"))



si_table19 <- stargazer(reg1, reg2, reg3, reg4, reg5,
                        align = TRUE, no.space = TRUE, type = 'text', df = FALSE, digits = 2,
                        font.size = "small", column.sep.width = "0.01pt", float = FALSE, header = FALSE,
                        se = list(reg1_r[,"Std. Error"], reg2_r[,"Std. Error"], reg3_r[,"Std. Error"],  reg4_r[,"Std. Error"], reg5_r[,"Std. Error"]),
                        covariate.labels = c("Public Sector Expenditure (1976-95, Per)", "Pop. Density (1946-75, logged)", "Rugged (logged)", "Malaria Risk (1965-75, logged)", "Island", 
                                             "Reliance on Oil (1946-75, logged)", "Urbanization (1946-75, logged)", "Threat to Sovereignty", "Democracy (1946-75)",
                                             "Violence at Independence", "UK Colony", 
                                             "Aid Per Capita (1961-75, logged)", "Historical Ethnic Frac (1946-75)", "Constant"), 
                        dep.var.labels=c("State Instability","Instability Index", "Political Risk"), 
                        omit.stat = c("adj.rsq", "ser"), 
                        omit = c("regionEurope and Central Asia", "regionLatin America and The Caribbean", 
                                 "regionMiddle East and North Africa", "regionSouth Asia", 
                                 "regionSub-Saharan Africa"), 
                        add.lines = list(c("Region Fixed Effects",
                                                "Yes", "Yes", "Yes", "Yes", "Yes")),
                        column.labels= c("", "(1996 - 2018)", "", "(1992 - 2020)", "(1992 - 2022)"))
                        
               

````



\begin{table}[ht!] \centering 
  \caption{Early State Size and Post Cold War Embeddedness} 
  \label{tab:table4public} 
  \resizebox{\textwidth}{!}{
```{r tidy=TRUE, tidy.opts=list(width.cutoff=65), warning=FALSE, echo=FALSE, results='asis'}


reg1 <- lm (trade.global.1992.2019 ~ log.avg.pop.1946.75 + region, data = data)

## Add political controls

reg2 <- lm (trade.global.1992.2019 ~ 
              log.avg.pop.1946.75 +
               log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 +
                 +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data)


reg3 <- lm (publicexp.imf.avg.1992.2011 ~ log.avg.pop.1946.75 + region, data = data)


reg4 <- lm (publicexp.imf.avg.1992.2011 ~ 
              log.avg.pop.1946.75 +
               log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 +
                 +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data)



# Make Post-Cold War Embedded Index Variables


# mean of trade.global.1992.2019  = 54.09

data$trade.global.1992.2019.standard <- (data$trade.global.1992.2019 - 54.09) / sd(data$trade.global.1992.2019, na.rm = TRUE)


# mean of public expenditure - 27.17

data$publicexp.imf.avg.1992.2011.standard <- (data$publicexp.imf.avg.1992.2011 - 27.17) / sd(data$publicexp.imf.avg.1992.2011, na.rm = TRUE)


## index

data$post_cw_embed <- 0.5*(data$publicexp.imf.avg.1992.2011.standard) + 0.5*(data$trade.global.1992.2019.standard)



reg5 <- lm (post_cw_embed ~ log.avg.pop.1946.75 + region, data = data)


reg6 <- lm (post_cw_embed ~ 
              log.avg.pop.1946.75 +
               log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 +
                 +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data)

            


#Calculating heteroscedasticity robust std errors
reg1_r <- coeftest(reg1, vcov. = vcovHC(reg1, type = "HC1"))
reg2_r <- coeftest(reg2, vcov. = vcovHC(reg2, type = "HC1"))
reg3_r <- coeftest(reg3, vcov. = vcovHC(reg3, type = "HC1"))
reg4_r <- coeftest(reg4, vcov. = vcovHC(reg4, type = "HC1"))
reg5_r <- coeftest(reg5, vcov. = vcovHC(reg5, type = "HC1"))
reg6_r <- coeftest(reg6, vcov. = vcovHC(reg6, type = "HC1"))

              
si_table20 <- stargazer(reg1, reg2, reg3, reg4, reg5, reg6, 
                        align = TRUE, no.space = TRUE, type = 'text', df = FALSE, digits = 2, font.size = "small",
                        column.sep.width = "0.01pt", float = FALSE,header = FALSE,
                        se = list(reg1_r[,"Std. Error"],  reg2_r[,"Std. Error"], reg3_r[,"Std. Error"], reg4_r[, "Std. Error"], reg5_r[, "Std. Error"], reg6_r[, "Std. Error"]),
                        covariate.labels = c("Avg.Population (1946-75, log)", "Pop. Density (1946-75, log)", "Rugged (log)", "Island",
                         "Reliance on Oil (1946-75, log)", "Malaria Risk (1965-75, log)", "Urbanization (1946-75, log)", "Threat to Sovereignty",
                                               "Democracy (1946-75)", "Violence at Independence", "UK Colony", 
                                               "Aid Per Capita (1960-75, log)", "Historical Ethnic Frac (1946-75)", "Constant",
                                               "Europe and Central Asia",
                                               "Latin America and The Caribbean", 
                                               "Middle East and North Africa", "South Asia", "Sub-Saharan Africa"),
                        omit.stat = c("adj.rsq", "ser"), 
                        omit = c("regionEurope and Central Asia", "regionLatin America and The Caribbean", 
                                 "regionMiddle East and North Africa", "regionSouth Asia",   "regionSub-Saharan Africa"), 
                        dep.var.labels=c("Trade Policy Open", "Public Sector Size", "Post-Cold War EL"), 
                         column.labels= c("(1992-2019)", "(1992-2019)", "(1992-2011)", "(1992-2011)", "(1992-2019)", "(1992-2019)"),
                        
                        
                        add.lines = list(c("Region Fixed Effects",
                                                "Yes", "Yes", "Yes", "Yes", "Yes", "Yes")))
                    

```



\begin{table}[ht!] \centering 
  \caption{Current Size and Post Cold War Embeddedness} 
  \label{tab:table4public} 
  \resizebox{\textwidth}{!}{
```{r tidy=TRUE, tidy.opts=list(width.cutoff=65), warning=FALSE, echo=FALSE, results='asis'}


# Create Current Size Variable

start_col <- which(names(data) == "X1992")  # Starting column index
end_col <- which(names(data) == "X2020")  # Ending column index

data$log.avg.pop.1992.20 = log(rowMeans(data[, start_col:end_col], na.rm = TRUE))


reg1 <- lm (trade.global.1992.2019 ~ log.avg.pop.1992.20 + region, data = data)

## Add political controls

reg2 <- lm (trade.global.1992.2019 ~ 
              log.avg.pop.1992.20 +
               log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 +
                 +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data)


reg3 <- lm (publicexp.imf.avg.1992.2011 ~ log.avg.pop.1992.20 + region, data = data)


reg4 <- lm (publicexp.imf.avg.1992.2011 ~ 
              log.avg.pop.1992.20 +
               log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 +
                 +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data)



reg5 <- lm (post_cw_embed ~ log.avg.pop.1992.20 + region, data = data)


reg6 <- lm (post_cw_embed ~ 
              log.avg.pop.1992.20 +
               log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 +
                 +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data)

            


#Calculating heteroscedasticity robust std errors
reg1_r <- coeftest(reg1, vcov. = vcovHC(reg1, type = "HC1"))
reg2_r <- coeftest(reg2, vcov. = vcovHC(reg2, type = "HC1"))
reg3_r <- coeftest(reg3, vcov. = vcovHC(reg3, type = "HC1"))
reg4_r <- coeftest(reg4, vcov. = vcovHC(reg4, type = "HC1"))
reg5_r <- coeftest(reg5, vcov. = vcovHC(reg5, type = "HC1"))
reg6_r <- coeftest(reg6, vcov. = vcovHC(reg6, type = "HC1"))

              
si_table21 <- stargazer(reg1, reg2, reg3, reg4, reg5, reg6, 
                        align = TRUE, no.space = TRUE, type = 'text', df = FALSE, digits = 2, font.size = "small",
                        column.sep.width = "0.01pt", float = FALSE,header = FALSE,
                        se = list(reg1_r[,"Std. Error"],  reg2_r[,"Std. Error"], reg3_r[,"Std. Error"], reg4_r[, "Std. Error"], reg5_r[, "Std. Error"], reg6_r[, "Std. Error"]),
                        covariate.labels = c("Avg.Population (1992-20, log)", "Pop. Density (1946-75, log)", "Rugged (log)", "Island",
                         "Reliance on Oil (1946-75, log)", "Malaria Risk (1965-75, log)", "Urbanization (1946-75, log)", "Threat to Sovereignty",
                                               "Democracy (1946-75)", "Violence at Independence", "UK Colony", 
                                               "Aid Per Capita (1960-75, log)", "Historical Ethnic Frac (1946-75)", "Constant",
                                               "Europe and Central Asia",
                                               "Latin America and The Caribbean", 
                                               "Middle East and North Africa", "South Asia", "Sub-Saharan Africa"),
                        omit.stat = c("adj.rsq", "ser"), 
                        omit = c("regionEurope and Central Asia", "regionLatin America and The Caribbean", 
                                 "regionMiddle East and North Africa", "regionSouth Asia", 
                                 "regionSub-Saharan Africa"), 
                        dep.var.labels=c("Trade Policy Open", "Public Sector Size", "Post-Cold War EL"), 
                         column.labels= c("(1992-2019)", "(1992-2019)", "(1992-2011)", "(1992-2011)", "(1992-2019)", "(1992-2019)"),
                        
                        
                        add.lines = list(c("Region Fixed Effects",
                                                "Yes", "Yes", "Yes", "Yes", "Yes", "Yes")))
                        
                 
     
```


## 5.  Mediation Analysis

```{r, }

data3 <- na.omit(data[, c("log.avg.gdp.92.20", "log.avg.pop.1946.75",
                          "trade.global.1976.91",
                          "log.pop.density.1961.75", "log.rugged", "island",   "log.reliance1", "log.malpct_aug1965.75",
                          "log.avg.urbanization.75", "sov.threat2",
                          "demo1946.75", "IndViol2", "uk", "log.avg.aid",
                          "avg_EF.1946.75", "region")])


reg1 <- lm (log.avg.gdp.92.20  ~ log.avg.pop.1946.75  +
               + log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 +
                 +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data3)


reg2 <- lm (log.avg.gdp.92.20  ~ trade.global.1976.91  +
               + log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 +
                 +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data3)


reg3 <- lm (log.avg.gdp.92.20  ~ trade.global.1976.91  +
             log.avg.pop.1946.75 + 
               + log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 +
                 +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data3)



data4 <- na.omit(data[, c("log.avg.gdp.92.20", "log.avg.pop.1946.75",
                          "publicexp.imf.avg.1976.1995",
                          "log.pop.density.1961.75", "log.rugged", "island",   "log.reliance1", "log.malpct_aug1965.75",
                          "log.avg.urbanization.75", "sov.threat2",
                          "demo1946.75", "IndViol2", "uk", "log.avg.aid",
                          "avg_EF.1946.75", "region")])


reg4 <- lm (log.avg.gdp.92.20  ~ 
             log.avg.pop.1946.75 + 
               + log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 +
                 +log.avg.urbanization.75 + sov.threat2 + demo1946.75 + IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data4)



reg5 <- lm (log.avg.gdp.92.20  ~ publicexp.imf.avg.1976.1995 +
               + log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 +
                 +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data4)


reg6 <- lm (log.avg.gdp.92.20  ~ publicexp.imf.avg.1976.1995  +
             log.avg.pop.1946.75 + 
               + log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 +
                 +log.avg.urbanization.75 + sov.threat2 + demo1946.75 + IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region, data = data4)


#Calculating heteroscedasticity robust std errors
reg1_r <- coeftest(reg1, vcov. = vcovHC(reg1, type = "HC1"))
reg2_r <- coeftest(reg2, vcov. = vcovHC(reg2, type = "HC1"))
reg3_r <- coeftest(reg3, vcov. = vcovHC(reg3, type = "HC1"))
reg4_r <- coeftest(reg4, vcov. = vcovHC(reg4, type = "HC1"))
reg5_r <- coeftest(reg5, vcov. = vcovHC(reg5, type = "HC1"))
reg6_r <- coeftest(reg6, vcov. = vcovHC(reg6, type = "HC1"))



si_table22 <- stargazer(reg1, reg2, reg3, reg4, reg5, reg6,  
                        align = TRUE, no.space = TRUE, type = 'text', df = FALSE, digits = 2, font.size = "small",
                        column.sep.width = "0.01pt", float = FALSE,header = FALSE,
                        se = list(reg1_r[,"Std. Error"],  reg2_r[,"Std. Error"], reg3_r[,"Std. Error"], reg4_r[, "Std. Error"],
                      reg5_r[, "Std. Error"], reg6_r[, "Std. Error"]),
                        covariate.labels = c(
                          
                           "Avg. Population Size (1946-75, logged)",
                           "Trade Openness (1976-91)",
                          "Public Sector Size (1976-95)",
                          "Pop. Density (1946-75, logged)", "Rugged (logged)", "Island",
                         "Reliance on Oil (1946-75, logged)", "Malaria Risk (1965-75, logged)", "Urbanization (1946-75, logged)", "Threat to Sovereignty",
                                               "Democracy (1946-75)", "Violence at Independence", "UK Colony", 
                                               "Aid Per Capita (1960-75, logged)", "Historical Ethnic Frac (1946-75)", "Constant"),
                      dep.var.labels=("Log(Avg.GDPpc, 1992-2020)"),
                        omit.stat = c("adj.rsq", "ser"), 
                        omit = c("region"), 
                       
                        add.lines = list(c("Region Fixed Effects",
                                                "Yes", "Yes", "Yes", "Yes", "Yes", "Yes" )))

```

## 6. Instrumental Variables (IV) Analysis 


\begin{table}[ht!] \centering 
  \caption{Instrumental Variable: Newly Independent Small States and Post-Cold War Economic Development} 
  \label{tab:tableinstrument} 
  \resizebox{\textwidth}{!}{
```{r echo=FALSE, results='hide',message=FALSE}



ivreg0 <- lm(log.avg.pop.1946.75 ~ pre1500AverageCaloriesmean + log.arable.land.75 + log.pop.density.1961.75 + log.rugged + island +
               log.reliance1 + log.malpct_aug1965.75+
               log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
               IndViol2 + uk + log.avg.aid + avg_EF.1946.75 +
               region, data = data)

reg0_r <- coeftest(ivreg0, vcov. = vcovHC(ivreg0, type = "HC1"))              



iv_reg1 <- ivreg(log.avg.gdp.92.20 ~ log.avg.pop.1946.75 +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 + 
               +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region | pre1500AverageCaloriesmean + log.arable.land.75 + log.pop.density.1961.75 +                log.rugged + island +
               log.reliance1 + log.malpct_aug1965.75+
               log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
               IndViol2 + uk + log.avg.aid + avg_EF.1946.75 +
               region, data = data)
              
            
 
iv_reg1_r <- coeftest(iv_reg1, vcov. = vcovHC(iv_reg1, type = "HC1")) 
reg1.summary <- as.list(summary(iv_reg1, vcov=sandwich, diagnostics = T))  
  



iv_reg2 <- ivreg(avg.rule.1996.19 ~ log.avg.pop.1946.75 +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 + 
               +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region | pre1500AverageCaloriesmean + log.arable.land.75 + log.pop.density.1961.75 +                log.rugged + island +
               log.reliance1 + log.malpct_aug1965.75+
               log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
               IndViol2 + uk + log.avg.aid + avg_EF.1946.75 +
               region, data = data)
              
              
 
iv_reg2_r <- coeftest(iv_reg2, vcov. = vcovHC(iv_reg2, type = "HC1")) 
reg2.summary <- as.list(summary(iv_reg2, vcov=sandwich, diagnostics = T)) 




iv_reg3 <- ivreg(fragility_2_mean ~ log.avg.pop.1946.75 +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 + 
               +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region | pre1500AverageCaloriesmean + log.arable.land.75 + log.pop.density.1961.75 +                log.rugged + island +
               log.reliance1 + log.malpct_aug1965.75+
               log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
               IndViol2 + uk + log.avg.aid + avg_EF.1946.75 +
               region, data = data)
              
              
 
iv_reg3_r <- coeftest(iv_reg3, vcov. = vcovHC(iv_reg3, type = "HC1")) 
reg3.summary <- as.list(summary(iv_reg3, vcov=sandwich, diagnostics = T)) 



iv_reg4 <- ivreg(trade.global.1976.91 ~ log.avg.pop.1946.75 +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 + 
               +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region | pre1500AverageCaloriesmean + log.arable.land.75 + log.pop.density.1961.75 +                log.rugged + island +
               log.reliance1 + log.malpct_aug1965.75+
               log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
               IndViol2 + uk + log.avg.aid + avg_EF.1946.75 +
               region, data = data)
              
              
 
iv_reg4_r <- coeftest(iv_reg4, vcov. = vcovHC(iv_reg4, type = "HC1")) 
reg4.summary <- as.list(summary(iv_reg4, vcov=sandwich, diagnostics = T)) 



iv_reg5 <- ivreg(publicexp.imf.avg.1976.1995 ~ log.avg.pop.1946.75 +
              log.pop.density.1961.75 + 
              log.rugged + island +
              + log.reliance1 + log.malpct_aug1965.75 + 
               +log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
              IndViol2 + uk + log.avg.aid +
              avg_EF.1946.75 + 
              region | pre1500AverageCaloriesmean + log.arable.land.75 + log.pop.density.1961.75 +                log.rugged + island +
               log.reliance1 + log.malpct_aug1965.75+
               log.avg.urbanization.75 + sov.threat2 + demo1946.75 +
               IndViol2 + uk + log.avg.aid + avg_EF.1946.75 +
               region, data = data)
              
              
 
iv_reg5_r <- coeftest(iv_reg5, vcov. = vcovHC(iv_reg5, type = "HC1")) 
reg5.summary <- as.list(summary(iv_reg5, vcov=sandwich, diagnostics = T)) 



si_table23 <- stargazer(ivreg0, iv_reg1, iv_reg2, iv_reg3, iv_reg4, iv_reg5,
                        model.names = FALSE,
                          align = TRUE, no.space = TRUE, type = 'text', df = FALSE, digits = 2, font.size = "small", column.sep.width = "0.01pt", float = FALSE,header = FALSE,
                          se = list(reg0_r[,"Std. Error"], iv_reg1_r[,"Std. Error"],  iv_reg2_r[,"Std. Error"],  iv_reg3_r[,"Std. Error"],  iv_reg4_r[,"Std. Error"],
                                    iv_reg5_r[,"Std. Error"]),  
                        covariate.labels = c("Pre-1500 Caloric Yield", "Arable Land (1975)", "Avg. Population (1946-75, logged)", "Density", "Rugged", "Island", "Oil Reliance", "Malaria Risk", "Urbanization", "Threat to Sovereignty",  "Democracy (1946 - 1975)", "Violence at Independence", "UK Colony",  "Aid Per Capita (1960-75)", "Historical Ethnic Frac"), 
                        add.lines = list(c(rownames(reg1.summary$diagnostics)[1],
                                               "",
                                                signif(reg1.summary$diagnostics[1, "statistic"], digits = 4),
                                               signif(reg2.summary$diagnostics[1, "statistic"], digits = 4),
                                               signif(reg3.summary$diagnostics[1, "statistic"], digits = 4),
                                               signif(reg4.summary$diagnostics[1, "statistic"], digits = 4),
                                               signif(reg5.summary$diagnostics[1, "statistic"], 
                                               digits = 4)),
                                         c("Region Fixed Effects",
                                                "Yes", "Yes", "Yes", "Yes", "Yes", "Yes")),
                      
                                              omit = c("regionEurope and Central Asia", "regionLatin America and The Caribbean", 
                                 "regionMiddle East and North Africa", "regionSouth Asia", 
                                 "regionSub-Saharan Africa"),
                        omit.stat = c("adj.rsq", "ser"), 
                        dep.var.labels=c("Avg. Population (logged)", "GDPPc (log)","Rule of Law", "Instability", "Trade", "Public Exp"),
                        column.labels= c("(1946 - 1975)", "(1992 - 2020)", "(1996 - 2019)", "(2006 - 2018)", "(1976-1992)", "(1976-1995)"))
                        
               
```
}
\end{table}


## 7. Other

```{r, }


reg1 <- lm(X2020 ~ X1976, data = data)

reg2 <- lm(log(X2020) ~ log(X1976), data = data)

data$small.population.1 <- ifelse(data$avg.pop.1946.75 < 1000000, 1, 0)

reg3 <- lm(X2020 ~ X1976, data = data[data$small.population.1 == 1, ])

reg4 <- lm(log(X2020) ~ log(X1976), 
           data = data[data$small.population.1 == 1, ])


reg1_r <- coeftest(reg1, vcov. = vcovHC(reg1, type = "HC1"))
reg2_r <- coeftest(reg2, vcov. = vcovHC(reg2, type = "HC1"))
reg3_r <- coeftest(reg3, vcov. = vcovHC(reg3, type = "HC1"))
reg4_r <- coeftest(reg4, vcov. = vcovHC(reg4, type = "HC1"))

si_table24 <- stargazer(reg1, reg2, reg3, reg4, 
                        align = TRUE, no.space = TRUE, type = 'text', df = FALSE, digits = 2,
                        font.size = "small", column.sep.width = "0.01pt", float = FALSE, header = FALSE,
                        se = list(reg1_r[,"Std. Error"], reg2_r[,"Std. Error"], reg3_r[,"Std. Error"],  reg4_r[,"Std. Error"]),
                        covariate.labels = c("Population (1976)", 
                                             "Population (logged, 1976)"), 
                        dep.var.labels=c("Population (2020)","Population (logged, 2020)",
                                         "Population (2020)","Population (logged, 2020)"
                                         ),
                         column.labels= c("All States", "All States", "Less 1 Million", "Less 1 Million"))
                        
               
```

